package com.test.demo;

import java.util.Scanner;

public class SearchNumDemo {
    public static void main(String[] args) {
        //需求：输出101~999之间的所有素数
        Scanner sc = new Scanner(System.in);
        test1();
    }

    public static void test1() {
        for (int i = 101; i < 1000; i++) {
            boolean flag = true;
            for (int j = 2; j < i; j++) {
                if (i % j == 0) {
                    flag = false;
                    break;
                }
            }
            if (flag) {
                System.out.println(i);
            }
        }
    }

}
